<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<html>
  <head>
  	<title>登录</title>
  	<script type="text/javascript">
			function refresh(){
				loginForm.imgValidate.src = "validate.jsp?id="+Math.random();
			}
	</script>
	<style type="text/css">
		a{
			color: white;
			text-decoration: none;
		}
		div{
			margin-top: 15%;
			margin-bottom: 15%;
		}
	</style>
  </head>
  
  <body background="${pageContext.request.contextPath}/image/login.png" style=" background-repeat:no-repeat ;background-size:100% 100%;
		background-attachment: fixed;">
		
		<%
			 String username = (String)session.getAttribute("usernamelogin");
			String password = (String)session.getAttribute("passwordlogin");
			String code =(String)session.getAttribute("code");
			if(username==null){
				username ="";
				password ="";
				code ="";
			}
		 %>
		
		<div align="center">
		<h2><font color="white">用户登录</font></h2>
   		<form name="loginForm" action="servlet/LoginServlet" method="post" class="color" >
  		<table  style=" color: white;">
  			<tr height="50">
  				<td>用户名：</td>
  				<td><input type="text" name="username" value="<%=username%>" ></td>
  			</tr>
  			<tr height="50">
  				<td>密&nbsp;&nbsp;&nbsp;&nbsp;码：</td>
  				<td ><input type="password" name="password" value="<%=password%>"></td>
  			</tr>
  			<tr height="50">
  				<td>验证码：</td>
  				<td ><input type="text" name="code"  value="<%=code%>"></td>
  				<td s><img name="imgValidate" src="validate.jsp" onclick="refresh()"><td>
  			</tr>
  			<tr height="50">
  				<td colspan="3" align="center"><input type="submit" value="登录"></td>
  			</tr>
  			<tr height="50">
  				<td colspan="3" align="center"><a href="register.jsp" >还未注册?点击此处前往注册</a></td>
  			</tr>
  		</table> 
		</form>
		</div>
  </body>
</html>


